<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class AboutYou::SDK::Model::Facet - RDoc Documentation</title>

<link href="../../../fonts.css" rel="stylesheet">
<link href="../../../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../../";
</script>

<script src="../../../js/jquery.js"></script>
<script src="../../../js/navigation.js"></script>
<script src="../../../js/search_index.js"></script>
<script src="../../../js/search.js"></script>
<script src="../../../js/searcher.js"></script>
<script src="../../../js/darkfish.js"></script>


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../../../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../../../table_of_contents.html#pages">Pages</a>
    <a href="../../../table_of_contents.html#classes">Classes</a>
    <a href="../../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    <div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  
  <p class="link">Object
  
</div>

    
    
    <!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    
    <li ><a href="#method-c-create_from_json">::create_from_json</a>
    
    <li ><a href="#method-c-new">::new</a>
    
    <li ><a href="#method-i-option">#option</a>
    
    <li ><a href="#method-i-unique_key">#unique_key</a>
    
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-AboutYou::SDK::Model::Facet">
  <h1 id="class-AboutYou::SDK::Model::Facet" class="class">
    class AboutYou::SDK::Model::Facet
  </h1>

  <section class="description">
    
<p>This class represents a <a href="Facet.html">Facet</a> model</p>

  </section>

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    
    <section class="constants-list">
      <header>
        <h3>Constants</h3>
      </header>
      <dl>
      
        <dt id="FACETS_ALL">FACETS_ALL
        
        <dd><p>api-call name for requiring all facets</p>
        
      
        <dt id="FACETS_UNLIMITED">FACETS_UNLIMITED
        
        <dd><p>api-call-value for requiring unlimited facets</p>
        
      
        <dt id="FACET_BRAND">FACET_BRAND
        
        <dd><p>Group Id for Brands</p>
        
      
        <dt id="FACET_CLOTHING_MEN_BELTS_CM">FACET_CLOTHING_MEN_BELTS_CM
        
        <dd><p>Group Id for Clothing_Men_Belts_Cm</p>
        
      
        <dt id="FACET_CLOTHING_MEN_DE">FACET_CLOTHING_MEN_DE
        
        <dd><p>Group Id for Clothing_Men_De</p>
        
      
        <dt id="FACET_CLOTHING_MEN_INCH">FACET_CLOTHING_MEN_INCH
        
        <dd><p>Group Id for Clothing_Men_Inch</p>
        
      
        <dt id="FACET_CLOTHING_UNISEX_INCH">FACET_CLOTHING_UNISEX_INCH
        
        <dd><p>Group Id for Clothing_Unisex_Inch</p>
        
      
        <dt id="FACET_CLOTHING_UNISEX_INT">FACET_CLOTHING_UNISEX_INT
        
        <dd><p>Group Id for Clothing_Unisex_Int</p>
        
      
        <dt id="FACET_CLOTHING_UNISEX_ONESIZE">FACET_CLOTHING_UNISEX_ONESIZE
        
        <dd><p>Group Id for Clothing_Unisex_Onesize</p>
        
      
        <dt id="FACET_CLOTHING_WOMEN_BELTS_CM">FACET_CLOTHING_WOMEN_BELTS_CM
        
        <dd><p>Group Id for Clothing_Women_Belts_Cm</p>
        
      
        <dt id="FACET_CLOTHING_WOMEN_DE">FACET_CLOTHING_WOMEN_DE
        
        <dd><p>Group Id for Clothing_Women_DE</p>
        
      
        <dt id="FACET_CLOTHING_WOMEN_INCH">FACET_CLOTHING_WOMEN_INCH
        
        <dd><p>Group Id for Clothing_Women_Inch</p>
        
      
        <dt id="FACET_COLOR">FACET_COLOR
        
        <dd><p>Group Id for Color</p>
        
      
        <dt id="FACET_CONDITION">FACET_CONDITION
        
        <dd><p>Group Id for Condition</p>
        
      
        <dt id="FACET_CUPSIZE">FACET_CUPSIZE
        
        <dd><p>Group Id for Cupsize</p>
        
      
        <dt id="FACET_DIMENSION3">FACET_DIMENSION3
        
        <dd><p>Group Id for Dimensions</p>
        
      
        <dt id="FACET_GENDERAGE">FACET_GENDERAGE
        
        <dd><p>Group Id for Gender/Age</p>
        
      
        <dt id="FACET_LENGTH">FACET_LENGTH
        
        <dd><p>Group Id for Length</p>
        
      
        <dt id="FACET_QUANTITY_PER_PACK">FACET_QUANTITY_PER_PACK
        
        <dd><p>Group Id for Quantity_Per_Pack</p>
        
      
        <dt id="FACET_SEASON_CODE">FACET_SEASON_CODE
        
        <dd><p>Group Id for Season Code</p>
        
      
        <dt id="FACET_SHOES_UNISEX_ADIDAS_EUR">FACET_SHOES_UNISEX_ADIDAS_EUR
        
        <dd><p>Group Id for Shoes_Unisex_Adidas_Eur</p>
        
      
        <dt id="FACET_SHOES_UNISEX_EUR">FACET_SHOES_UNISEX_EUR
        
        <dd><p>Group Id for Clothing_Unisex_Eur</p>
        
      
        <dt id="FACET_SIZE">FACET_SIZE
        
        <dd><p>Group Id for Size</p>
        
      
        <dt id="FACET_SIZE_CODE">FACET_SIZE_CODE
        
        <dd><p>Group Id for Size-Codes</p>
        
      
        <dt id="FACET_SIZE_RUN">FACET_SIZE_RUN
        
        <dd><p>Group Id for Size_Run</p>
        
      
      </dl>
    </section>
    

    
    <section class="attribute-method-details" class="method-section">
      <header>
        <h3>Attributes</h3>
      </header>

      
      <div id="attribute-i-group_id" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">group_id</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>id of the group of the facet</p>
        
        </div>
      </div>
      
      <div id="attribute-i-group_name" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">group_name</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>name of the group of the facet</p>
        
        </div>
      </div>
      
      <div id="attribute-i-id" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">id</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>id of the facet</p>
        
        </div>
      </div>
      
      <div id="attribute-i-json_object" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">json_object</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p><a href="Facet.html#attribute-i-json_object">#json_object</a> with which
this instance was created</p>
        
        </div>
      </div>
      
      <div id="attribute-i-name" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">name</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>name of the facet</p>
        
        </div>
      </div>
      
      <div id="attribute-i-options" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">options</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>options of the facet</p>
        
        </div>
      </div>
      
      <div id="attribute-i-value" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">value</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        
        <p>value of the facet</p>
        
        </div>
      </div>
      
    </section>
    

    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Class Methods</h3>
       </header>

    
      <div id="method-c-create_from_json" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">create_from_json</span><span
            class="method-args">(json_object)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method is used for creating an instance of this class by a
json_object.</p>
<ul><li>
<p><strong>Args</strong>    :</p>
<ul><li>
<p><code>json_object</code> -&gt; the <a
href="Facet.html#attribute-i-json_object">#json_object</a> received from
the api</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>Instance of <a href="Facet.html">AboutYou::SDK::Model::Facet</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="create_from_json-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Model/facet.rb, line 108</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">create_from_json</span>(<span class="ruby-identifier">json_object</span>)
  <span class="ruby-identifier">new</span>(
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'facet_id'</span>],
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'name'</span>],
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'value'</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'value'</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>,
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'id'</span>],
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'group_name'</span>],
      <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'options'</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">json_object</span>[<span class="ruby-string">'options'</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
  )
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(id, name, value, group_id, group_name, options = nil)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>Constructor for the <a href="Facet.html">AboutYou::SDK::Model::Facet</a>
class</p>
<ul><li>
<p><strong>Args</strong> :</p>
<ul><li>
<p><code>id</code> -&gt; the id of the facet</p>
</li><li>
<p><code>name</code> -&gt; the name of the facet</p>
</li><li>
<p><code>value</code> -&gt; the value of the facet</p>
</li><li>
<p><code>group_id</code> -&gt; id of the group of the facet</p>
</li><li>
<p><code>group_name</code> -&gt; name of the group of the facet</p>
</li><li>
<p><code>options</code> -&gt; options of the facet</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>an instance of <a href="Facet.html">AboutYou::SDK::Model::Facet</a></p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Model/facet.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">group_id</span>, <span class="ruby-identifier">group_name</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">id</span>         = <span class="ruby-identifier">id</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">name</span>       = <span class="ruby-identifier">name</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">value</span>      = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">group_id</span>   = <span class="ruby-identifier">group_id</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">group_name</span> = <span class="ruby-identifier">group_name</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">options</span>    = <span class="ruby-identifier">options</span>

  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Instance Methods</h3>
       </header>

    
      <div id="method-i-option" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">option</span><span
            class="method-args">(key)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>Getter for options</p>
<ul><li>
<p><strong>Args</strong> :</p>
<ul><li>
<p><code>key</code> -&gt; The key for which options should be returned</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>either null if no options are set or a String containing an option</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="option-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Model/facet.rb, line 146</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">option</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>
  <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">option</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">option</span>[<span class="ruby-string">'value'</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">option</span>[<span class="ruby-string">'key'</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">key</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
      <div id="method-i-unique_key" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">unique_key</span><span
            class="method-args">(group_id = nil, facet_id = nil)</span>
          
          <span class="method-click-advice">click to toggle source</span>
          
        </div>
        

        <div class="method-description">
          
          <p>This method is used for creating a unique key for a facet</p>
<ul><li>
<p><strong>Args</strong> :</p>
<ul><li>
<p><code>group_id</code> -&gt; id of the group of a facet</p>
</li><li>
<p><code>facet_id</code> -&gt; id of a facet</p>
</li></ul>
</li><li>
<p><strong>Returns</strong> :</p>
<ul><li>
<p>a String containing a unique key for a facet</p>
</li></ul>
</li></ul>
          
          

          
          <div class="method-source-code" id="unique_key-source">
            <pre><span class="ruby-comment"># File lib/AboutYou/Model/facet.rb, line 129</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">unique_key</span>(<span class="ruby-identifier">group_id</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">facet_id</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-constant">String</span>(<span class="ruby-identifier">group_id</span>) <span class="ruby-operator">+</span> <span class="ruby-string">':'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">String</span>(<span class="ruby-identifier">facet_id</span>) <span class="ruby-keyword">unless</span>
  <span class="ruby-identifier">group_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">facet_id</span>.<span class="ruby-identifier">nil?</span>

  <span class="ruby-constant">String</span>(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">group_id</span>) <span class="ruby-operator">+</span> <span class="ruby-string">':'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">String</span>(<span class="ruby-identifier">id</span>) <span class="ruby-keyword">unless</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">group_id</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">facet_id</span>.<span class="ruby-identifier">nil?</span>
<span class="ruby-keyword">end</span></pre>
          </div>
          
        </div>

        

        
      </div>

    
    </section>
  
  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

